﻿@model Zor_Web.Models.Stat.V_HouseRegisterStreetOffice
@using Webdiyer.WebControls.Mvc;
@using Zor_Tools;
@{
    Layout = null;
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>房屋登记分析图表(街道办)</title>
    <link href="~/Content/LayerUI/src/css/layui.css" rel="stylesheet" />
    <link href="~/Content/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Content/Styles/zor.css" rel="stylesheet" />
    <!-- 框架必要 -->
    <script src="~/Content/Scripts/jquery/jquery-1.9.1.min.js"></script>
    <script src="~/Content/Scripts/learunui-framework.js"></script>
    <script src="~/Content/Scripts/Zor_AJax.js"></script>
    <!-- 消息提示 -->
    <script language='javascript' src='~/Content/layer/layer.js'></script>
    <!--柱状图 -->
    <script src="~/Content/Scripts/Echart/echarts.min.js"></script>
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="HrCharts"></div>
</body>
</html>
<script>

    //获取街道办对应的税收部门数据
    var strSOName;
    getAjax("/Stat/GetCommunityName", "", function (data) {
        strSOName = eval(data);
    })

    //获取街道办对应的登记住宅数数据
    var HouNumber;
    getAjax("/Stat/GetStreetOfficeHouNum", "", function (data) {
        HouNumber = eval(data);
    })
    //获取街道办对应的登记非住宅数数据
    var ShopNumber;
    getAjax("/Stat/GetStreetOfficeShopNum", "", function (data) {
        ShopNumber = eval(data);
    })
    //获取街道办对应的登记受理数数据
    var ANumber;
    getAjax("/Stat/GetStreetOfficeANum", "", function (data) {
        ANumber = eval(data);
    })

    // 基于准备好的dom，初始化echarts实例
    var myChart = document.getElementById('HrCharts');

    var myChartContainer = function () {
        myChart.style.width = (window.innerWidth - 50) + 'px';
        myChart.style.height = (window.innerHeight) + 'px';
    };
    myChartContainer();
    var eChart = echarts.init(myChart);
    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '房屋登记统计表(街道办)'
        },
        toolbox: {
            show: true,
            feature: {
                mark: { show: true },
                dataView: { show: true, readOnly: false },
                restore: { show: true },
                saveAsImage: { show: true }
            }
        },
        tooltip: {},
        legend: {
            data: ['非住宅数', '住宅数', '受理数']
        },
        xAxis: [{
            type: 'category',
            data: strSOName,
            axisLabel: {
                interval: 0,
                rotate: 30
            }
        }],
        yAxis: {
            type: 'value'
        },
        series: [
            {
                name: '非住宅数',
                type: 'bar',
                data: ShopNumber
            },
            {
                name: '住宅数',
                type: 'bar',
                data: HouNumber
            },
            {
                name: '受理数',
                type: 'bar',
                data: ANumber
            }
        ]

    };

    // 使用刚指定的配置项和数据显示图表。
    eChart.setOption(option);
    //浏览器大小改变时重置大小
    window.onresize = function () {
        myChartContainer();
        eChart.resize();
    };
</script>



